Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

promise-delay

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

promise-delay

like Promise.resolve with a delay in milliseconds

  • 2.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

promise-delay

like Promise.resolve with a delay in milliseconds

Circle CI js-standard-style

Note: For node 0.10 support, use promise-delay@1.x to include polyfill-promise

usage

var promiseDelay = require('promise-delay')

var eventually = promiseDelay(100, Promise.resolve('foo'))

eventually.then(next)

// you can also cast non-Promises to delayed promises

var later = promiseDelay(100, false)

later.then(function (val) {
    console.log(val)
    // => false
  })

or, reject after a delay:

var rejected = promiseDelay.reject(100, new Error('rejected'))

rejected.catch(function (err) {
  console.log(err)
  // Error: rejected
})

installation

$ npm install promise-delay

running the tests

From package root:

$ npm install
$ npm test

contributors

license

ISC. (c) MMXIV jden jason@denizac.org. See LICENSE.md

Keywords

FAQs

Package last updated on 22 Feb 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc